package com.my;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

/**
 * 过滤敏感字
 * <p>
 * Created by YJH on 2017/7/13 20:27.
 */
public class MyHttpServletRequest extends HttpServletRequestWrapper {

    public MyHttpServletRequest(HttpServletRequest request) {
        super(request);
    }

    @Override
    public String getParameter(String name) {
        String val = super.getParameter(name);
        if (val != null && val.contains(" fuck ")) {
            val = val.replace("fuck", "****");
        }
        return val;
    }
}
